<?php
// P. Couchet 06/06/2011

session_start();
set_time_limit (0);
ini_set('memory_limit', '512M');

// Fichier de configuration en fonction du serveur
include('../config/config.php');

// Utiliser en absence de port
//$socket = '/applis/webinist/home/var/run/mysql.sock';

$dsn='mysql:host='.$host.';port='.$port.';dbname='.$dbname;

//$nomBase='mysql:host=193.54.3.161;dbname=nabio';
//$nomBase='mysql:host=hippo;port=50000;dbname=mmd_rmb2_utf8';
//$nomBase='mysql:host=localhost;unix_socket=/applis/webinist/home/var/run/mysql.sock;dbname=nabio';

// Haut de page
include('../templates/'.$template.'/up.php');
// Connexion, création de $a, inclusion de model.php
include('../action/statusAction.php');
// Home About
if ((empty($_GET) and empty($_POST)) or isset($_GET['p'])) include('../templates/'.$template.'/pInfo.php');

else{
	// Simple search
	if(isset($_GET['s'])){
		if(!empty($_GET['s'])) include('../action/sAction.php');
		include('../templates/'.$template.'/sForm.php');
		if(isset($totalResults) and $totalResults > 0) include('../templates/'.$template.'/results.php');
	}
	// Advanced search
	if(isset($_GET['a'])){
		include('../action/aAction.php');
		include('../templates/'.$template.'/aForm.php');
		if(isset($totalResults) and $totalResults > 0) include('../templates/'.$template.'/results.php');
	}
	// List
	if(isset($_GET['l'])){
		if(!empty($_GET['l'])) include('../action/lAction.php');
		include('../templates/'.$template.'/lForm.php');
		if(isset($totalResults) and $totalResults > 0) include('../templates/'.$template.'/results.php');
	}
	// Statistics
	if(isset($_GET['x'])){
		include('../action/xAction.php');
		include('../templates/'.$template.'/xInfo.php');
	}
	// Contact
	if(isset($_GET['h'])) include('../templates/'.$template.'/hInfo.php');
	// Mentions légales
	if(isset($_GET['c'])) include('../templates/'.$template.'/cInfo.php');
	// Accessibilité
	if(isset($_GET['e'])) include('../templates/'.$template.'/eInfo.php');
	// Crédits
	if(isset($_GET['r'])) include('../templates/'.$template.'/rInfo.php');
}

include('../templates/'.$template.'/down.php');

?>
